#ifndef MUSIC_H
#define MUSIC_H

#include <QMainWindow>
#include <QFile>
#include <QMouseEvent>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QByteArray>
#include <QStandardItemModel>
#include <QHeaderView>
#include <QUrl>
#include <QMediaPlayer>
#include <QMediaPlaylist>


#include "maininterface.h"

namespace Ui {
class music;
}

class music : public QMainWindow
{
    Q_OBJECT

public:
    explicit music(QWidget *parent = nullptr);
    ~music();

public slots:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void replyFinished(QNetworkReply *reply);

    void parseJson(QByteArray byteArray);

    void positionChangedSlot(qint64 position);
    void durationChangedSlot(qint64 duration);
private slots:
    void on_closeButton_clicked();

    void on_searchPushButton_clicked();

    void on_pausePushButton_clicked();

    void on_tableView_doubleClicked(const QModelIndex &index);

    void on_horizontalSlider_sliderReleased();

    void on_nepushButton_clicked();

    void on_prepushButton_clicked();

private:
    Ui::music *ui;
    QPoint mouseOff;
    QNetworkAccessManager * manager;
    QStandardItemModel* model;
    QString m;
    bool flag;
    QMediaPlayer * player;
    QMediaPlaylist * playlist;
};

#endif // MUSIC_H
